package com.google.gwt.sample.dynatablerf.server;

import com.google.gwt.sample.dynatablerf.server.business.ControladorFactory;
import com.google.gwt.sample.dynatablerf.server.domain.Material;
import com.google.web.bindery.requestfactory.shared.Locator;

public class MaterialLocator extends Locator<Material, Long> {

	@Override
	public Material create(Class<? extends Material> clazz) {
		return new Material();
	}

	@Override
	public Material find(Class<? extends Material> clazz, Long id) {
		return ControladorFactory.getControladorMaterial().findById(id);
	}

	@Override
	public Class<Material> getDomainType() {
		return Material.class;
	}

	@Override
	public Long getId(Material domainObject) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public Class<Long> getIdType() {
		return Long.class;
	}

	@Override
	public Object getVersion(Material domainObject) {
		return domainObject.getVersion();
	}

}
